package com.baibei.ebec.sdk;

import com.baibei.model.BannerInfo;
import com.baibei.model.BaseHttpResponse;
import com.baibei.model.FloatPriceInfo;
import com.baibei.model.HomeIndexInfo;
import com.baibei.model.NewHomeIndexInfo;
import com.baibei.model.ShipmentInfo;
import com.baibei.model.lastinfo;

import java.util.List;

import io.reactivex.Observable;
import okhttp3.RequestBody;
import retrofit2.http.Body;
import retrofit2.http.Field;
import retrofit2.http.FormUrlEncoded;
import retrofit2.http.Headers;
import retrofit2.http.POST;

/**
 * 产品/船接口
 * Created by ChenRui on 2017/4/28 0028 14:00.
 */
public interface IProductApi {


    /**
     * 查询船期列表
     *
     * @param produceArea #商品类型 XAG 白银  XAU 黄金 XPT 铂金   全部传ALL
     * @param page        当前页
     */
    @POST(ApiConstant.API_SHIPMENT_LIST)
    @FormUrlEncoded
    Observable<List<ShipmentInfo>> queryShipment(@Field("area") String produceArea, @Field("page") int page);

    /**
     * 获取首页banner
     *
     * @return return
     */
    @POST(ApiConstant.API_QUERY_BANNER)
    Observable<List<BannerInfo>> getBannerInfos();


    /**
     * 获取金银铜关市价格
     *
     * @return return
     */
    @POST(ApiConstant.API_RANKING_LIST_LONDON)
    Observable<lastinfo> getClosePrice();


    /**
     * 获取首页弹窗信息
     */
    @POST(ApiConstant.API_DIALOG_INFO)
    @FormUrlEncoded
    Observable<List<ShipmentInfo>> getDialogInfo();

    /**
     * 获取首页数据
     *
     * @return return
     */
    @POST(ApiConstant.API_RANKING_LIST_LONDON)
    Observable<HomeIndexInfo> getHomeIndexInfos();

    /**
     * 新的获取首页数据
     */
    @POST(ApiConstant.API_HOME_INDEX_DATA_NEW)
    Observable<NewHomeIndexInfo> getHomeIndexInfosNew();


    @POST(ApiConstant.API_SET_PRICE_FLOAT)
    @FormUrlEncoded
    Observable<BaseHttpResponse<FloatPriceInfo>> setFloatPrices(@Field("userId") String userId,
                                                               @Field("lowPrice") String lowPrice,
                                                               @Field("topPrice") String topPrice,
                                                               @Field("productId") String productId);
    @POST(ApiConstant.API_SET_PRICE_FLOAT)
    Observable<BaseHttpResponse<FloatPriceInfo>> setFloatPrice(@Body RequestBody requestBody);
}
